With developments of communication technology, the electronic device (such as the smart phone) is more and more popular. In a process of using the electronic device, for example during a call, in order to avoid the user's misoperations of the electronic device, when the user's face approaches the electronic device to a certain distance, the display screen of the electronic device will go out automatically.
Generally, the electronic device senses the ambient light intensity through the ambient-light sensor, and controls the brightness of the display screen of the electronic device according to the sensed data.